package com.yonyou.brigade.third_parties.fanscar.util;

import com.yonyou.brigade.third_parties.fanscar.model.FanscarJobGrade;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 职级转换工具类
 * </p>
 *
 * @author admin
 * @since : 2019-03-07
 */
public class JobGradeConvertUtil {

    public static FanscarJobGrade convertToFanscarJobGrade(Map<String, String> duty) {
        FanscarJobGrade fanscarJobGrade = new FanscarJobGrade();
        fanscarJobGrade.setJobGradeCode(duty.get("id"));
        fanscarJobGrade.setJobGradeName(duty.get("name"));
        return fanscarJobGrade;
    }

    public static List<FanscarJobGrade> convertToFanscarJobGradeList(List<Map<String, String>> dutyList) {
        List<FanscarJobGrade> fanscarJobGradeList = new ArrayList<>();
        for (Map<String, String> duty : dutyList) {
            FanscarJobGrade fanscarJobGrade = convertToFanscarJobGrade(duty);
            fanscarJobGradeList.add(fanscarJobGrade);
        }
        return fanscarJobGradeList;
    }
}
